import {Directive, ElementRef, Input} from "@angular/core";

@Directive({
  selector:'[beauty]'
})

export class BeautyDirective{

  private el:HTMLElement;

  @Input('beauty')
  set backgroundColor(colorName:string){
    if(colorName != null && colorName != ''){
      this.el.style.backgroundColor=colorName;
    }
  };

  constructor(el:ElementRef){
    this.el=el.nativeElement;
  }
}